//
//  UserInfoCell.m
//  WangLottery
//
//  Created by 黄修勇 on 12-5-6.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "UserInfoCell.h"

@implementation UserInfoCell

@synthesize titleLabel=_titleLabel;
@synthesize inforLabel=_inforLabel;

-(void)dealloc{

    [_titleLabel release];
    [_inforLabel release];
    [super dealloc];
}


- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        
        UIFont *font=[UIFont systemFontOfSize:14.0f];
        
        UILabel *tempTitle=[[UILabel alloc]initWithFrame:CGRectMake(20.0f, 0.0f, 100.0f, self.contentView.frame.size.height)];
        tempTitle.autoresizingMask=UIViewAutoresizingFlexibleHeight;
        tempTitle.backgroundColor=[UIColor clearColor];
        tempTitle.font=font;
        self.titleLabel=tempTitle;
        [tempTitle release];
        
        UILabel *tempInfo=[[UILabel alloc]initWithFrame:CGRectMake(self.contentView.frame.size.width-150.0f-10.0f, 0.0f, 150.0f, self.contentView.frame.size.height)];
        tempInfo.backgroundColor=[UIColor clearColor];
        tempInfo.textAlignment=UITextAlignmentRight;
        tempInfo.textColor=[UIColor redColor];
        tempInfo.font=font;
        tempInfo.autoresizingMask=UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleLeftMargin;
        self.inforLabel=tempInfo;
        [tempInfo release];
    }
    return self;
}

-(void)setInforLabel:(UILabel *)inforLabel{

    if ([_inforLabel isEqual:inforLabel]) {
        return;
    }
    
    [_inforLabel removeFromSuperview];
    [_inforLabel release];
    _inforLabel=[inforLabel retain];
    [self.contentView addSubview:_inforLabel];
}

-(void)setTitleLabel:(UILabel *)titleLabel{

    if ([_titleLabel isEqual:titleLabel]) {
        return;
    }
    [_titleLabel removeFromSuperview];
    [_titleLabel release];
    _titleLabel=[titleLabel retain];
    [self.contentView addSubview:_titleLabel];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
